home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / games / mdlv13.zip / MDLSRC.ZIP / MDL.H < prev    next >
C/C++ Source or Header  |  1996-07-10  |  2KB  |  95 lines

  1. //
  2. // this file by brian martin 1996
  3. // brian@phyast.pitt.edu
  4. //
  5. // this is part of the source for the MedDLe quake model viewer/editor
  6. //
  7. #include<stdio.h>
  8. #include<stdlib.h>
  9. #include<conio.h>
  10. #include<dos.h>
  11. #include<string.h>
  12. #include<limits.h>
  13. #include"bg_grx.h"
  14. //#include"bg_3d.h"
  15. #include"bg_mouse.h"
  16. #include<grx20.h>
  17.  
  18. struct vframe{
  19.     int atype;
  20.     int anims;
  21.     int n1,n2;
  22.     unsigned char *n3;
  23.     unsigned char minbound[3];
  24.     unsigned char unknown1;
  25.     unsigned char maxbound[3];
  26.     unsigned char unknown2;
  27.     char name[16];
  28.     unsigned char *v;
  29. };
  30.  
  31. struct MDL_FILE{
  32.     char filetype[4];
  33.     int version;
  34.     float xscale,yscale,zscale;
  35.     float xoffset,yoffset,zoffset;
  36.     float radius;
  37.     float f1,f2,f3;
  38.     unsigned num_items;
  39.     unsigned bitmapw;
  40.     unsigned bitmaph;
  41.     unsigned num_vertices;
  42.     unsigned num_triangles;
  43.     unsigned num_frames;
  44.     unsigned blank;
  45.     float unkn1;
  46.                 unsigned unkn2;
  47.     unsigned char *bitmap;
  48.     unsigned int *vertex;
  49.     unsigned int *triangle;
  50.     struct vframe *frame;
  51.     char filename[128];
  52. };
  53.  
  54. extern struct MDL_FILE mdl;
  55. extern unsigned char pal[256*3];
  56. extern unsigned char cmap[256*32];
  57.  
  58. extern int mdl_3d(MDL_FILE *);
  59. extern int mdl_2d(MDL_FILE *);
  60. extern void write_mdl(FILE *out, MDL_FILE *m);
  61. extern void read_mdl(FILE *in, MDL_FILE *m);
  62. extern void setup_3d_data(MDL_FILE *m);
  63. extern void delete_3d_data(MDL_FILE *m);
  64.  
  65.  
  66. #define win_width 3.20
  67. #define win_height 2.40
  68. #define focus 2.00
  69.  
  70.  
  71. #define FLAT_SHADING    0x1     // constant colour polygon
  72. #define GOURAUD_SHADED  0x2     // Gouraud shaded polygon
  73. #define TEXTURED        0x3      // texture mapped polygon
  74. #define ARROW_LEFT  75
  75. #define ARROW_RIGHT 77
  76. #define ARROW_UP    72
  77. #define ARROW_DOWN  80
  78. #define KEY_ENTER       13
  79. #define KEY_SPACE       32
  80. #define KEY_TAB          9               /* all i can think of */
  81.  
  82. typedef struct situation {
  83.     BG_3pt pos;
  84.     BG_Matrix pos_matrix;
  85.     BG_Matrix dir_matrix;
  86.     unsigned int ix, iy;
  87.     };
  88.  
  89. extern BG_Block *block;
  90. extern BG_Object *object;
  91.  
  92.  
  93.  
  94.  
  95.